<?php
// 试卷表 migration
use think\migration\Migrator;
use Phinx\Db\Adapter\MysqlAdapter;

class ExamPaper extends Migrator
{
    public function change()
    {
        $table = $this->table('exam_paper');
        $table->addColumn('title', 'string', ['limit' => 255, 'default' => '', 'comment' => '试卷标题'])
            ->addColumn('description', 'text', ['null' => true, 'comment' => '试卷说明'])
            ->addColumn('total_score', 'integer', ['default' => 0, 'comment' => '总分'])
            ->addColumn('duration', 'integer', ['default' => 60, 'comment' => '考试时长(分钟)'])
            ->addColumn('question_count', 'integer', ['default' => 0, 'comment' => '题目数量'])
            ->addColumn('create_time', 'integer', ['default' => 0])
            ->addColumn('update_time', 'integer', ['default' => 0])
            ->create();
    }
}
